package bb.lanxing.net.utils;

import org.json.JSONException;
import org.json.JSONObject;

public class JsonUtils {
    public static String toJson(Object... keyValues) {
        int i;
        if (keyValues == null) {
            return "{}";
        }
        JSONObject jSONObject = new JSONObject();
        for (int i2 = 0; i2 < keyValues.length && (i = i2 + 1) < keyValues.length; i2 += 2) {
            try {
                jSONObject.put(String.valueOf(keyValues[i2]), keyValues[i]);
            } catch (JSONException unused) {
            }
        }
        return jSONObject.toString();
    }
}
